package com.explorati.interview.interview.chaptereight;

public class MyThread extends Thread {

	public static int index = 0;
	public static Object obj = new Object();

	public void run() {
		synchronized (obj) {
			for (int i = 0; i < 5; i++) {
				System.out.println(getName() + " : " + index++);
			}
		}
	}
}
